<template>
    <el-dialog
      :visible.sync="dialogProtocol"
      width="50vw"
      :close-on-click-modal="false"
      :show-close="false"
      :before-close="dialogBeforeClose"
      append-to-body
      class="dialog"
    >
    <div class="registerTitle">
      <div class="registerLogin">
          <div class="registerWel">{{type === 1 ? '服务条款' : '隐私条款'}}</div>
      </div>
      <i class="el-icon-close" @click="dialogBeforeClose()"></i>
    </div>
    <div v-if="dialogProtocol">
      <iframe
        :src="`https://www.hz-sevencolor.top/${htmlUrl}?t=${t}`"
        allowtransparency="true"
        class="iframe"
        title="test"
        frameborder="0"
        scrolling="auto">
    </iframe>
    </div>
    </el-dialog>
  </template>

<script>
export default {
  name: 'register',
  components: {
  },

  data () {
    return {
      dialogProtocol: false,
      htmlUrl: '',
      t: new Date().getTime(),
      type: null
    }
  },
  computed: {
  },
  created () {
  },

  methods: {
    getData (type) {
      this.type = type
      this.t = new Date().getTime()
      if (type === 1) {
        this.htmlUrl = 'user.html'
      }
      if (type === 2) {
        this.htmlUrl = 'privacy.html'
      }
      this.dialogProtocol = true
    },
    // 关闭
    dialogBeforeClose () {
      this.dialogProtocol = false
    }
  }
}
</script>
<style  scoped lang="scss">
::v-deep .el-dialog {
    border-radius: 0 !important;
    margin-top: 5vh !important;
    background: #fff;
    .el-dialog__title {
      display: none;
    }
    .el-dialog__header {
      display: none;
    }
}
::v-deep .registerTitle {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin: 0 0 2.5vh 0;
    span {
        color: #00C586;
    }
    .registerWel {
        color: #000;
        font-size: 1.5vw;
        font-weight: bold;
    }
    .registerHas {
        color: #999999;
        margin-top: 0.5vh
    }
    .el-icon-close {
        font-size: 1.3vw
    }
}
.iframe {
  background-color: transparent;
  width: 100%;
  height: 70vh;
}
</style>
